<?php

require_once dirname(__FILE__).'/../lib/recursoGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/recursoGeneratorHelper.class.php';

/**
 * recurso actions.
 *
 * @package    proyectoMOD2
 * @subpackage recurso
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class recursoActions extends autoRecursoActions
{
  public function executeList_cancel(sfWebRequest $request)
  {
    $this->redirect('@recurso');
  }
  
  public function executeBusqueda()
  {
    $c= new Recurso();
    $this->tabla= $c->getRecursos(); 
  }
  
    public function executeBusquedarecursoap()
  {
    $c= new Recurso();
    $this->tabla= $c->getRecursos(); 
  }
  
     public function executeRecursoap($peticion)
  {
			$c = new Criteria();
			$c->add(RecursoPeer::ID, $peticion->getParameter('recurso'));
			$this->setVar('recurso', RecursoPeer::doSelectOne($c));
		    $c= new Recurso();
			$this->tabla1= $c->getMisActividadesR($this->recurso->getId());
  }
  
  public function executeIndividual1($peticion)
  {
     $c= new Recurso();
    $this->tabla= $c->getRendimientoIndividual($peticion->getParameter('recurso'));
	$this->nombrep= $c->getNombreCompleto($peticion->getParameter('recurso'));
    $this->recurso= $peticion->getParameter('recurso');
  }
  
  public function executeIndividual2($peticion)
  {
     $c= new Recurso();
    $this->tabla= $c->getRendimientoIndividualExportar($peticion->getParameter('recurso'));
	$this->nombrep= $c->getNombreCompleto($peticion->getParameter('recurso'));
	$this->setLayout(false);
    $this->getResponse()->setContentType('application/msexcel');
  }
  
  public function executeGrupal1($peticion)
  {
     $c= new Recurso();
    $this->tabla= $c->getRendimientoGrupal();
  }
  
}
